﻿#include "common.h"

// 清理输入缓冲区
void clear_input_buffer()
{
	while (getchar() != '\n')
		continue;
}

//void clear_input_buffer(char ch) // 纯 C 不支持函数重载
//{
//	while (getchar() != '\n') {
//		printf("%c ASCII 码：%d\n", ch, ch);
//	}
//}

#if defined(_MSC_VER)
main() // main 函数是特殊函数，MSVC 编译器支持不用声明类型
#else
int main()  // 但是为了考虑兼容性，最好还是加上类型声明
#endif
{
	// 调用函数
	print_start_line("study01 start");
	study01();
	print_end_line("study01 end");

	print_start_line("study02 start");
	study02();
	print_end_line("study02 end");

	print_start_line("study03 start");
	study03();
	print_end_line("study03 end");

	print_start_line("study04 start");
	study04();
	print_end_line("study04 end");

	print_start_line("study05 start");
	study05();
	print_end_line("study05 end");

	print_start_line("study06 start");
	study06();
	print_end_line("study06 end");

	print_start_line("study07 start");
	study07();
	print_end_line("study07 end");

	print_start_line("study08 start");
	study08();
	print_end_line("study08 end");

	print_start_line("study09 start");
	study09();
	print_end_line("study09 end");

	print_start_line("study10 start");
	study10();
	print_end_line("study10 end");

	print_start_line("study11 start");
	study11();
	print_end_line("study11 end");

	print_start_line("study12 start");
	study12();
	print_end_line("study12 end");

	print_start_line("study13 start");
	study13();
	print_end_line("study13 end");

	print_start_line("study14 start");
	study14();
	print_end_line("study14 end");

	// 等待输入
	printf("Press Enter key to exit.");
	int ch;
	while ((ch = getchar()) != '\n')
		printf("%c ASCII 码：%d\n", ch, ch);
	
	return 0;
}
